
////////////////////////////////////////////////////////////
// Headers
////////////////////////////////////////////////////////////
#include <SFML/Window.hpp>
#include <SFML/Graphics.hpp>
#include <SFML/Audio.hpp>
//#include <SFML/Joystick.hpp>
#include <iostream>
#include <math.h>

int main()
{
    sf::RenderWindow window(sf::VideoMode(800, 600, 32), "SFML Windows!");
    window.EnableVerticalSync(true);

    sf::ConvexShape player1(3);
    player.addPoint(0, )
    player1.addPoint()
    bool running = true;

    while(running)
    {
        while (window.PollEvent(e))
        {
            switch (e.Type)
            {
                case sf::Event::Closed:
                    window.Close();
                    running = false;
                    break;
            }
        }
        if(timer.GetElapsedTime().AsSeconds() > 0.025f)
            {
                sf::Vector2f v = ball.GetPosition();
                sf::Vector2f vect(sf::Joystick::GetAxisPosition(0, sf::Joystick::X), sf::Joystick::GetAxisPosition(0, sf::Joystick::Y));
                vect*=1-(sf::Joystick::GetAxisPosition(0, sf::Joystick::Z)+100)/200.0f;
                v+=vect;
                if (v.x > 800)
                    v.x-=800;
                if (v.x < 0)
                    v.x += 800;
                if (v.y > 600)
                    v.y-=600;
                if (v.y < 0)
                    v.y+=600;
                ball.SetPosition(v);
            }
        window.Clear(sf::Color::Black);
        window.Draw(ball);
        window.Display();
    }
    return EXIT_SUCCESS;
}
